﻿using sixgod.Common.Model;
using sixgod.Dtos.System;
using sixgod.Dtos.WorkFlow;
using sixgod.Dtos.WorkFlow.Search;
using sixgod.Model.WorkFlowTemplate;
using SqlSugar;

namespace sixgod.Service.WorkFlowTemplate;

public interface IWorkFlowTemplateService:ISimpleClient<Model.WorkFlowTemplate.WorkFlowTemplate>
{
    /// <summary>
    /// 分页 查询
    /// </summary>
    /// <param name="query"></param>
    /// <returns></returns>
    Task<PageResponseResult<WorkFlowTemplateOutDto>> GetPageList(WorkFlowTemplateQuery query);

    /// <summary>
    /// 获取用于下拉的模板
    /// </summary>
    /// <returns></returns>
    Task<List<SelectDto>> GetTemplateList();

    /// <summary>
    /// 获取当前用户可发起的流程
    /// </summary>
    /// <returns></returns>
    Task<List<SelectDto>> GetUsersTemplateList();

    /// <summary>
    /// 新增模板
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    Task InsertWorkTemplate(WorkFlowTemplateInputDto data);

    /// <summary>
    /// 获取流程可发起人信息
    /// </summary>
    /// <param name="templateId">流程Id</param>
    /// <returns></returns>
    Task<List<WorkFlowStartInfo>> GetWorkFlowStartInfo(string templateId);

    /// <summary>
    /// 表单内容新增
    /// </summary>
    /// <param name="list"></param>
    /// <returns></returns>
    Task InsertFormItem(List<TemplateFormItem> list);

    /// <summary>
    /// 获取表单项
    /// </summary>
    /// <param name="workFlowId">模板ID</param>
    /// <returns></returns>
    Task<List<TemplateFormItemDto>> GetTemplateFormItems(string workFlowId);

    /// <summary>
    /// 获取流程设计
    /// </summary>
    /// <param name="workFlowId"></param>
    /// <returns></returns>
    Task<FlowDesignDto> GetFlowDesignDto(string workFlowId);

    /// <summary>
    /// 获取流程所有信息
    /// </summary>
    /// <param name="workFlowId"></param>
    /// <returns></returns>
    Task<(List<WorkFlowTemplateNode>,List<TemplateNodeLink>)> GetTemplateInfos(string workFlowId);

    /// <summary>
    /// 新增流程设计
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    Task InsertFlowDesign(FlowDesignInDto data);

    /// <summary>
    /// 删除模板
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    Task DeleteTemplate(string id);

    /// <summary>
    /// 根据节点ID获取审核人/抄送人
    /// </summary>
    /// <param name="nodeId"></param>
    /// <returns></returns>
    Task<List<NodeAuditSetting>> GetNodePointAuditer(string nodeId);
}